package com.多线程07.demo05;

public class MyRunable implements Runnable {
    public void run() {
        System.out.println(Thread.currentThread().getName()+"沉睡了");
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+"苏醒了");
    }


    public static void main(String[] args) {
        MyRunable mr = new MyRunable();

        Thread t1 = new Thread(mr, "飞机");
        Thread t2 = new Thread(mr, "大炮");

        t1.start();
        t2.start();

    }

}
